package com.gbb.simple.ui;

import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;

import com.gbb.simple.base.TitleFragmentActivity;
import com.gbb.simple.R;

/**
 * @author gaobingbing
 */
public class WidgetStyleActivity extends TitleFragmentActivity {

    @Override
    protected void onCreateAfter(Bundle savedInstanceState){
        addLayout(R.layout.activity_widget_style);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu){
        menu.add(0,1,103,"测试").setTitle("测试").setIcon(R.drawable.ic_launcher).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
        getMenuInflater().inflate(R.menu.menu_widget_style,menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item){
        switch(item.getItemId()) {

            case R.id.action_share:
                showToast("分享");
                return true;

            case R.id.action_settings:
                showToast("设置");
                return true;

            default:
                return false;
        }
    }

    @Override
    protected void initTitleBar(){
        mToolbar.setNavigationIcon(R.drawable.ic_action_back);
        mToolbar.setNavigationOnClickListener(getFinishListener());
    }

}
